import upload from '@/utils/upload'
import request from '@/utils/request'

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
  const data = {
    oldPassword,
    newPassword
  }
  return request({
    url: '/system/user/profile/update-password',
    method: 'PUT',
    params: data
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return upload({
    url: '/system/user/profile/update-avatar',
    method: 'PUT',
    name: data.name,
    filePath: data.filePath
  })
}

// 查询电站信息分页
export function getStationPage(params){
	return request({
	  url: '/oper/station/searchByKey',
	  method: 'GET',
	  params: params
	})
}

export function getStation(id){
	return request({
	  url: '/oper/station/get',
	  method: 'GET',
	  params: {id:id}
	})
	
}

export function update(params){
	return request({
	  url: '/oper/station/update',
	  method: 'PUT',
	  data: params
	})	
}



  // // 查询电站信息详情
  // getStation: async (id: number) => {
  //   return await request.get({ url: `/oper/station/get?id=` + id })
  // },

  // // 新增电站信息
  // createStation: async (data: StationVO) => {
  //   return await request.post({ url: `/oper/station/create`, data })
  // },

  // // 修改电站信息
  // updateStation: async (data: StationVO) => {
  //   return await request.put({ url: `/oper/station/update`, data })
  // },
